<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Array扩展</title>
</head>
<body>
    <script>
        // let arr = new Array(3);// 标识数组的长度
        // console.log(arr);//[3]  [undefined,undefined,undefined]

        // let arr2 = new Array(1,2,3,4);// 数组的元素
        // console.log(arr2);

        // Array.of(元素)
        // let arr1 = Array.of(3);
        // console.log(arr1);
        // let arr2 = Array.of(1,2,3,4,5);
        // console.log(arr2);

        // // fill(元素,start,end)

        // let arr = [1,2,3,4,5,6,7];
        // arr.fill(5, 2,4);
        // console.log(arr);

        let arr = [1,2,3,4,5,NaN];
        // -1 没有  有 : 索引 0 ....
        let res = arr.indexOf(NaN);
        console.log(res);

        // 查找数组是否有当前元素，有true 没有：false
        let res2 = arr.includes(NaN);
        console.log(res2);







    </script>
</body>
</html>